package com.rz.htk.dubbo.service;

import consumer.AdminInfoService;
import consumer.DictService;
import consumer.model.Admin;
import consumer.model.SysDictData;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdminService {

    @Reference(version = "1.0.0", url = "dubbo://127.0.0.1:12345")
    private AdminInfoService adminInfoService;

    public Admin getById(Integer adminId){
        return this.adminInfoService.getById(adminId);
    }

    public List<Admin> getByIds(List<Integer> adminIds){
        return this.adminInfoService.getByIds(adminIds);
    }

    /**
     * 获取指定用户的子孙级用户id列表（不包含自身id）
     * @param id
     * @return
     */
    public List<Integer> getChildrenIds(Integer id){
        return this.adminInfoService.getChildrenIds(id);
    }

    /**
     * 获取指定用户的子孙级用户列表（不包含自身）
     * @param id
     * @return
     */
    public List<Admin> getChildren(Integer id){
        return this.adminInfoService.getChildren(id);
    }
}
